<?php
echo $this->Form->create('AppConfig', array(
	'class' => 'validate',
	'action' => 'edit',
	'url' => $this->request->here(false),
	'type' => 'post',
	'inputDefaults' => array('label' => false, 'div' => false)));
?>
<div class="page-header">
	<div class="icon">
		<span class="ico-pen-2"></span>
	</div>
	<h1>
		<?php echo __('System configuration'); ?> 
		<small><?php echo __('ONLINE LUCKY DRAW SYSTEM'); ?></small>
	</h1>
	<div class="page-toolbar pull-right">
		<div class="btn-group ctr-container">
			<a class="btn btn-primary ctr-add" href="<?php echo Router::url(array('controller' => 'users', 'action' => 'index')) ?>">
				<span class="ico-add"></span>
				<?php echo __('Users management'); ?>
			</a>
			<!--
			<a class="btn btn-primary ctr-add" href="<?php echo Router::url(array('controller' => 'rewards', 'action' => 'index')) ?>">
				<span class="ico-add"></span>
				<?php echo __('Rewards management'); ?>
			</a>
			-->
		</div>
	</div>
</div>
<div class="row-fluid">
	<?php echo $this->Session->flash(); ?>
</div>
<div class="row-fluid">

	<div class="span6">                

		<div class="block">
			<div class="head">                                
				<h2><?php echo __('Basic info'); ?></h2>                     
			</div>                                        
			<div class="data-fluid">
				<div class="row-form">
					<div class="span3"><?php echo __('Received email'); ?>:</div>
					<div class="span9">
						<?php
						echo $this->Form->input('RewardEmail', array('type' => 'text'));
						?> 
					</div>
				</div>
				<div class="row-form">
					<div class="span3"><?php echo __('Email subject'); ?>:</div>
					<div class="span9">
						<?php
						echo $this->Form->input('RewardEmailSubject', array('type' => 'text'));
						?> 
					</div>
				</div>
				<div class="row-form">
					<div class="span3"><?php echo __('Reward expired days'); ?>:</div>
					<div class="span9">
						<?php
						$list = range(1, 99);
						echo $this->Form->input('RewardExpiredDay', array('type' => 'select', 'options' => array_combine($list, $list)));
						?> 
					</div>
				</div>

				<div class="row-form">
					<div class="span3"><?php echo __('Date format'); ?>:</div>
					<div class="span9">
						<?php
						$list = array(
							'l, F j, Y', 'l, j F, Y', 'l, Y,  F j', 'l, F j, Y', 'l, j. F Y',
							'm/d/Y', 'd/m/Y', 'Y/m/d', 'M j Y', 'Y M j', 'j M Y'
						);
						foreach ($list as $val) {
							$options[$val] = date($val);
						}
						echo $this->Form->input('RewardDateFormat', array('type' => 'select', 'options' => $options));
						?>  
					</div>
				</div>
			</div>
		</div>

	</div>

	<div class="span6">                

		<div class="block">
			<div class="head">                                
				<h2><?php echo __('Other info'); ?></h2>                                                            
			</div>                                    
			<div class="data-fluid">
				<div class="row-form">
					<div class="span3"><?php echo __('Display email use to sent'); ?>:</div>
					<div class="span9">
						<?php
						echo $this->Form->input('EmailSender', array('type' => 'text'));
						?> 
					</div>
				</div>
				<div class="row-form">
					<div class="span3"><?php echo __('Reward Condition'); ?>:</div>
					<div class="span9">
						<?php
						echo $this->Form->input('RewardCondition', array('type' => 'textarea', 'style' => 'width : 400px;'));
						?>                         
					</div>
				</div>
				<div class="row-form">
					<div class="span3"><?php echo __('Price description'); ?>:</div>
					<div class="span9">
						<?php
						echo $this->Form->input('RewardPriceDescription', array('type' => 'textarea', 'style' => 'width : 400px;'));
						?>                         
					</div>
				</div>

			</div>                
		</div>
	</div>     

	<div class="span11">
		<div class="span6">
			<div class="span3">&nbsp;</div>
			<div class="span9">
				<div class="btn-group ctr-container">
					<button class="btn btn-large btn-info" type="reset"><?php echo __('Reset'); ?></button>
					<button class="btn btn-large btn ctr-save" type="submit"><?php echo __('Submit'); ?></button>
				</div>
			</div>
		</div>
	</div>
</div>
<?php echo $this->Form->end(); ?>